from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi_mcp import FastApiMCP
from api.routes import router
import uvicorn


app = FastAPI(
    title="WebP to PNG Converter",
    description="A FastAPI service for converting WebP images to PNG format with MCP integration",
    version="0.1.0",
    docs_url="/docs",
    redoc_url="/redoc"
)

# 挂载静态文件目录
app.mount("/static", StaticFiles(directory="static"), name="static")

# 包含API路由
app.include_router(router)

# 创建 MCP 实例
mcp = FastApiMCP(
    app, 
    name="webp-to-png-converter",
    description="Convert WebP images to PNG format"
)

# 挂载 MCP 服务
mcp.mount_http()

if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8000)


